﻿using Lk.WebTow.Common.Cache;
using Lk.WebTow.Models;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;

namespace Lk.WebTow.Common.Config
{
    public class ConfigSite
    {
        public SiteConfig LoadConfig()
        {
            var model = CacheHelper.Get<SiteConfig>(ProjectConfig.CACHE_SYS_CONFIG);
            if (model == null)
            {
                CacheHelper.Set(ProjectConfig.CACHE_SYS_CONFIG,
                    (SiteConfig)SerializationHelper.Load(typeof(SiteConfig), Utils.GetXmlMapPath(ProjectConfig.CACHE_SYS_CONFIG)));
            }
            return model;
        }
    }
}
